import { $Http } from '@/config/service/http';

export enum Api {
  // 文件生效
  filePage = '/dmsfile/publicFileTrainProcess/page', // 分页查询
  fileGet = '/dmsfile/publicFileTrainProcess/get', // 详情
  fileTemplateDownload = '/dmsfile/resourceFileInfo/downloadFile', // 下载
  treeDataSubject = '/system/subject/listSimple', //查询机构树以及用户
  fileAuto = '/dmsfile/publicFileProcessOrder/autoProductFormInfo', // 自动生成表单
  trainingPrequalification = '/dmsfile/publicFileTrainProcess/trainingPrequalification', // 培训预审
  takeEffectConfirmation = '/dmsfile/publicFileTrainProcess/takeEffectConfirmation', // 培训确认
  trainingConfirmation = '/dmsfile/publicFileTrainProcess/trainingConfirmation' // 生效确认
}

export const filePage = (params) => {
  return $Http.api(Api.filePage, params, 'post');
};

export const fileGet = (id) => {
  return $Http.api(Api.fileGet + '/' + id, null, 'get');
};

export const fileAuto = () => {
  return $Http.api(Api.fileAuto, null, 'post');
};

export const trainingPrequalification = (params) => {
  return $Http.api(Api.trainingPrequalification, params, 'post');
};

export const takeEffectConfirmation = (params) => {
  return $Http.api(Api.takeEffectConfirmation, params, 'post');
};

export const trainingConfirmation = (params) => {
  return $Http.api(Api.trainingConfirmation, params, 'post');
};

export const treeDataSubject = (params: any) => {
  return $Http.api(Api.treeDataSubject, params, 'post');
};

export const fileTemplateDownload = (id, params) => {
  return $Http.api(Api.fileTemplateDownload + '/' + id, params, 'get');
};
